package com.szqhyxj.youxiangju.biz.card.addCard;

import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import com.szqhyxj.youxiangju.BaseActivity;
import com.szqhyxj.youxiangju.R;
import com.szqhyxj.youxiangju.biz.card.CardActivity;
import com.szqhyxj.youxiangju.sys.components.NavigationBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class BindCardErrActivity extends BaseActivity implements NavigationBar.NavigationBarListener{

    public static final String CONTENT = "content";

    @BindView(R.id.navigationBar)
    NavigationBar navigationBar;
    @BindView(R.id.content)
    TextView content;

    public static void start(BaseActivity activity,String msg) {
        Intent intent = new Intent();
        intent.putExtra(CONTENT,msg);
        intent.setClass(activity, BindCardErrActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bind_card_err);
        ButterKnife.bind(this);
        navigationBar.setNavigationBarListener(this);
        Intent intent = getIntent();
        String stContent = intent.getStringExtra(CONTENT);
        content.setText(stContent);
    }

    @OnClick(R.id.anew_bin)
    public void onViewClicked(View view){
        switch(view.getId()){
            case R.id.anew_bin:
                finish();
                break;
        }
    }

    @Override
    public void navigationLeft(){
        CardActivity.start(this);
    }

    @Override
    public void navigationRight(){
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event){
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            CardActivity.start(this);
        }
        return super.onKeyDown(keyCode, event);
    }
}
